<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let p1 = new Promise((resolve, reject) => {
            let count = 3;
            if (count > 5) {
                resolve('成功')
            } else {
                reject('失败')
            }
        }).then(res => {
            console.log(res)
        }, err => {
            console.log(err)
        })
        console.log(p1)

        let p2 = new Promise((resolve, reject) => {
            let count = 5;
            if (count < 10) {
                resolve('成功')
            } else {
                reject('失败')
            }
        })

        p2.then(
            (res) => {
                console.log(res)
            },
            (err) => {
                console.log(err)
            })

        let p3 = new Promise((resolve, reject) => {
            let flag = true;
            if (flag) {
                resolve('success')
            } else {
                reject('fail')
            }

        }).then((res) => {
            console.log(res)
        }, (err) => {
            console.log(err)
        })
    </script>
</body>

</html>